package com.ruoyi.yuyuan.Controller;

import com.ruoyi.yuyuan.DTO.Result;
import com.ruoyi.yuyuan.Service.IMyBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: kestrel
 * @Version:1.0
 * @Date: 2024/5/29
 */
@RestController
@RequestMapping("/myBlog")
public class MyBlogController {
    @Autowired
    IMyBlogService myBlogService;

    @GetMapping("/agreeBlog/{blogType}/{userId}/{startId}")
    public Result getUserAgrees(@PathVariable Short blogType, @PathVariable Long userId, @PathVariable Long startId){
        return myBlogService.getUserAgrees(blogType, userId, startId);
    }

    @GetMapping("/dailyBlog/{userId}/{startId}")
    public Result getUserDailies(@PathVariable Long userId, @PathVariable Long startId){
        return myBlogService.getUserDailies(userId, startId);
    }

    @GetMapping("/dealBlog/{userId}/{startId}")
    public Result getUserDeals(@PathVariable Long userId, @PathVariable Long startId){
        return myBlogService.getUserDeals(userId, startId);
    }

    @GetMapping("/practiceBlog/{userId}/{startId}")
    public Result getUserPractices(@PathVariable Long userId, @PathVariable Long startId){
        return myBlogService.getUserPractices(userId, startId);
    }

    //展示热帖
    @GetMapping("/hotBlog/{blogType}")
    public Result getHotBlog(@PathVariable Integer blogType){
        return myBlogService.getHotBlog(blogType);
    }

}
